﻿using System;
using System.Collections.Generic;
using Acaweb.Data.Contracts;
using Acaweb.Model.Entities;
using Acaweb.Model.Entities.DatosCompuestos;
using Spring.Transaction.Interceptor;

namespace Acaweb.Data.Dao.NHibernate
{
    public class DocentesDao : HibernateDao<Docentes, string>, IDocentesDao
    {
        public IList<Docentes> GetAll()
        {
            return GetAll<Docentes>();
        }

        public Docentes GetByEmail(string Email)
        {
            IList<Docentes> Lista = this.Session.QueryOver<Docentes>().Where(t => t.Email == Email).List();
            if (Lista.Count > 0)
                return Lista[0];
            else
                return null;
        }

        public Docentes GetByUsername(string Username)
        {
            return this.Session.QueryOver<Docentes>().Where(t => t.Username == Username).List()[0];
        }
    }
}
